# Maintainer: kpcyrd <kpcyrd[at]archlinux[dot]org>
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Joaquim Monteiro <joaquim.monteiro@protonmail.com>

pkgname=mvt
pkgver=2.4.3
pkgrel=1
pkgdesc="Mobile Verification Toolkit, a forensics tool looking for signs of device compromise"
arch=(any)
url="https://github.com/mvt-project/mvt"
license=(custom:MVT)
depends=(
  'libusb'
  'python'
  'python-adb-shell'
  'python-appdirs'
  'python-click'
  'python-cryptography'
  'python-iosbackup'
  'python-libusb1'
  'python-packaging'
  'python-pyahocorasick'
  'python-requests'
  'python-rich'
  'python-simplejson'
  'python-tld'
  'python-tqdm'
  'python-yaml'
)
makedepends=(
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
source=("mvt-${pkgver}.tar.gz::https://github.com/mvt-project/mvt/archive/refs/tags/v${pkgver}.tar.gz")
sha512sums=('0b9efa057fe7d029175344b48779478f399e0d922d25b8c79719141d6c030a0b7b71417f97cefd773039e5c9bed5e69fa96dd712654b30bfae818e4ce61bc9d4')
b2sums=('7ae80c357b27adfb675f3fc3c8fac88df5fc712d3075cb6024c4acab9ad9542c54c96ba8e4a1119d98d40cbac4aee3c135abef873fccc00f524eedc6315f96be')

build() {
  cd "mvt-${pkgver}"
  python -m build -wn
}

check() {
  cd "mvt-${pkgver}"
  dev/mvt-android --help
  dev/mvt-ios --help
}

package() {
  cd "mvt-${pkgver}"
  python -m installer -d "${pkgdir}" dist/*.whl
  install -Dm644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
  local _py3_ver=$(python --version | cut -d " " -f2)
  rm -rf "$pkgdir/usr/lib/python${_py3_ver%.*}/site-packages/tests"
}

# vim: ts=2 sw=2 et:
